/*
 * hkh-project
 * leafteamwork.blogspot.com
 * Tool: Netbeans 6.7.1 - SQL Server 2005
 */

package vn.com.hkh.service;

import java.util.Collection;
import vn.com.hkh.dao.BookDAO;
import vn.com.hkh.dto.BookDTO;

/**
 *
 * @author leaf
 */
public class BookService {

    BookDAO bookDAO = new BookDAO();

    /**
     * Create Book
     * @param _dto
     * @return BookDTO
     */
    public BookDTO create(BookDTO _dto) {
        return bookDAO.create(_dto);
    }

     /**
     * Update Booking
     * @param _dto
     * @return BookDTO
     */
    public BookDTO store(BookDTO _dto) {
        return bookDAO.update(_dto);
    }

    /**
     * Read All Booking
     * @return Collection<BookDTO>
     */
    public Collection<BookDTO> findBookings() {
        return bookDAO.readByAll();
    }

    /**
     * Read Booking by Id
     * @param _pk
     * @return BookDTO
     */
    public BookDTO findByPrimarykey(String _pk) {
        return bookDAO.readByID(_pk);
    }

    /**
     * Delete Booking
     * @param _id
     * @return boolean
     */
    public boolean remove(String _id) {
        return bookDAO.deleteById(_id);
    }
}
